package se.joakimback.decorator.view;

import java.awt.Component;
import java.awt.Label;

import javax.swing.JLabel;
import javax.swing.JSlider;

public class ComponentFactory {
	public static JSlider newSlider(int pMin, int pMax) {
		JSlider vSlider = new JSlider(pMin, pMax);
		vSlider.setMajorTickSpacing(pMax / 2);
		vSlider.setMinorTickSpacing(Math.max(pMax / 20, 1));
		vSlider.setPaintTicks(true);
		vSlider.setSnapToTicks(true);
		
		return vSlider;
	}
	
	public static Component newLabel(String pText) {
		Label vLabel = new Label(pText);
		vLabel.setAlignment(Label.RIGHT);
		
		return vLabel;
	}
	
	public static JLabel newIcon(String pText) {
		JLabel vLabel = new JLabel(pText);
		
		return vLabel;
	}
}
